﻿mergeInto(LibraryManager.library, {
    
    Hello: function () {
        window.alert("Hello, world!");
    },

    HelloString: function (str) {
        window.alert(Pointer_stringify(str));
    },

    AddNumbers: function (x, y) {
        return x + y;
    },
    
    StringReturnValueFunction: function () {
        var returnStr = "bla";
        
        var bufferSize = lengthBytesUTF8(returnStr) + 1;
        var buffer = _malloc(bufferSize);
        stringToUTF8(returnStr, buffer, bufferSize);

        return buffer;
    },
});